/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.zhangtai;


//import com.spring4all.swagger.EnableSwagger2Doc;
import com.zhangtai.utils.SnowflakeIdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.nio.charset.StandardCharsets;

//@EnableCanalClient
@EnableCaching
@SpringBootApplication
@EnableScheduling
@EnableSwagger2
@MapperScan(value = "com.zhangtai.modules.dao")
public class EhrAdminApp {

	public static void main(String[] args) {
		SpringApplication.run(EhrAdminApp.class, args);
	}

	@Bean
	public RestTemplate restTemplate() {
		RestTemplate restTemplate = new RestTemplate();
		restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
		return restTemplate;
	}

	@Bean
	public SnowflakeIdWorker getS(){
		return new SnowflakeIdWorker(1,1);
	}

}